/*
 *	This file is part of Lounge-Cast.
 *
 *  Author:  	Markus Moormann
 *	E-mail:  	mmoorman@uni-osnabrueck.de
 *	Copyright:	University of Osnabrueck (Zentrum Virtuos)
 * 	Website:	www.uni-osnabrueck.de
 *	Date:		16.02.2011
 *
 *	Lounge-Cast is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *	Lounge-Cast is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Lounge-Cast.  If not, see <http://www.gnu.org/licenses/>.
 */
package multimedia.model.vo
{
	import mx.collections.ArrayCollection;
	
	/**
	 * class representing a video
	 */
	[Bindable]
	[RemoteClass(alias="backend.vo.VideoVO")]
	public class VideoVO extends MediaVO
	{
		
		/**
		 * the URL pointing to the video
		 */
		public var url:String;
		/**
		 * the URL pointing to a subtitles file
		 */
		public var subtitles:String;
		/**
		 * the volume of the video (0..1)
		 */
		public var volume:Number;
		/**
		 * the in point where to start the video from
		 */
		public var in_point:Number;
		/**
		 * the out point where to stop the video
		 */
		public var out_point:Number;
		/**
		 * aspect ratio of the video ('16:9'|'4:3')
		 */
		public var aspect_ratio:String;
		/**
		 * a set of captions
		 */
		public var captionSets:ArrayCollection;
		/**
		 * whether the video is in composition with a text or not
		 */
		public var in_composition:Boolean;
		
		/**
		 * default constructor
		 */
		public function VideoVO(){};
		
		/**
		 * method to get an instance of VideoVO
		 * 
		 * @param media the media containing all common data
		 * @param url the URL pointing to the video
		 * @param subtitles the URL pointing to a subtitles files
		 * @param in_point the point from where to start the video from
		 * @param out_point the point to stop the video
		 * @param aspect_ratio aspect ratio of the video ('16:9'|'4:3')
		 * @param in_composition whether the video is in composition with a text or not
		 */
		public static function getInstance( media:MediaVO,
											url:String,
											subtitles:String,
											volume:Number,
											in_point:Number,
											out_point:Number,
											aspect_ratio:String,
											in_composition:Boolean):VideoVO
		{
			var video:VideoVO = new VideoVO();
			video.media_id = media.media_id;
			video.added = media.added;
			video.addedBy = media.addedBy;
			video.approved = media.approved;
			video.converted = media.converted;
			video.duration = media.duration;
			video.newsticker = media.newsticker;
			video.playlist_id = media.playlist_id;
			video.position = media.position;
			video.reference = media.reference;
			video.title = media.title;
			video.type = media.type;
			video.start_date = media.start_date;
			video.valid_date = media.valid_date;
			video.category = media.category;
			
			video.url = url;
			video.subtitles = subtitles;
			video.volume = volume;
			video.in_point = in_point;
			video.out_point = out_point;
			video.aspect_ratio = aspect_ratio;
			video.in_composition = in_composition;
			
			return video;
		}

	}
}